package com.xxchat.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author Waicc
 */

@Getter
@AllArgsConstructor
public enum SysVersionStatusEnum {
    INIT(0, "未发布"),
    GRAYSCALE(1, "灰度发布"),
    ALL(2, "全网发布");

    private final Integer status;
    private final String desc;

    public static SysVersionStatusEnum getByStatus(Integer status) {
        for (SysVersionStatusEnum sysVersionStatusEnum : SysVersionStatusEnum.values()) {
            if (Objects.equals(sysVersionStatusEnum.getStatus(), status)) {
                return sysVersionStatusEnum;
            }
        }
        return null;
    }
}
